#ifndef __TVWHEEL_H
#define __TVWHEEL_H

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif

#include <stdint.h>
struct TimerNode{
    uint32_t wheel;
    uint32_t Solt;
    UNTPTR *event;
    struct TimerNode *next;
};
struct TimeWheel {
    uint32_t wheelPower;
    uint32_t wheelSize;  //时间轮槽数
    uint32_t interval; //槽的单位时间长度
    uint32_t currentSlot; // 当前时间轮的槽位置
    struct TimerNode **slots; //时间轮槽数组指针
};
struct TimeWheel  *TimeWheelCreate(uint32_t wheelPower,uint32_t wheelSize,uint32_t intervalSec);
int TimeWheelInsert(struct TimeWheel *timeWheel,struct TimeNode *timeNode );
void TimeWheelDelete(struct TimeWheel *timeWheel,struct TimeNode *timeNode );
void TimeWheelRun(struct TimeWheel *timeWheel);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif